private static string GeneratePassword(int length, bool lowerCase, bool upperCase, bool numbers,
                                               bool specialChars)
        {
            //Coded by Rue
            Random passRand = new Random();

            string pass = string.Empty;
            string buffer = string.Empty;

            const string LOWER = "abcdefghijklmnopqrstuvwxyz";
            const string UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
            const string NUM = "0123456789";
            const string SPECIAL = "<>?:\"{}|+_)(*&^%$#@!`~[]=-\';/.,";

            if (lowerCase) buffer += LOWER;
            if (upperCase) buffer += UPPER;
            if (numbers) buffer += NUM;
            if (specialChars) buffer += SPECIAL;

            char[] chars = buffer.ToCharArray();

            for (int i = 0; i <= length; i++)
                pass += chars[passRand.Next(chars.Length)];

            return pass;
        }